<?php
/*
 * @Description    : 
 * @Version        : 1.0.0
 * @Author         : QianLong
 * @Date           : 2021-03-29 23:35:46
 * @LastEditors    : QianLong
 * @LastEditTime   : 2024-05-15 11:21:04
 */

namespace app\index\controller;

use app\BaseController;
use app\common\RedisCache;
use app\common\requestPay;
use app\common\service\Alipay;
use app\common\service\AliyunShiRen;
use app\common\service\CircleSeal2;
use app\common\service\Contract;
use app\common\service\JDCloud;
use app\common\service\Wxpay;
use think\facade\Db;

class Index extends BaseController
{
	public function alipay()
	{
	}
	public function test()
	{
		$result = sendTKfMsg('onPoR5_8pjiR0T38FovosfuQv218','text',json_encode(['content'=>'测试一下'], JSON_UNESCAPED_UNICODE));
		var_dump($result);
	}
	public function to_url($id = '')
	{
		$infoData = Db::connect('mongodb')->name('short_url')->where('_id', $id)->find();
		if (empty($infoData)) {
			echo '内容无效';
			exit;
		}
		if ($infoData['expire_time'] != 99999 && $infoData['expire_time'] < time()) {
			echo '链接失效';
			exit;
		}
		return redirect($infoData['url'], 302);
	}
}
